package com.zc.study.thread.多线程第七章节.SolveTwo;



import java.text.SimpleDateFormat;

/**
 * 使用单例类的SimpleDateFormat在多线程的环境下极易出现错误
 */
public class Run {
    public static void main(String[] args) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String[] dateArray = new String[]{"2018-01-22","2018-02-22","2018-03-22"};
        ThreadA[] threadAList = new ThreadA[3];
        for(int i= 0;i<3;i++){
            threadAList[i] = new ThreadA(sdf,dateArray[i]);
        }
        for(int i= 0;i<3;i++){
            threadAList[i].start();
        }
    }
}
